import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    title: '网页的页签栏标题',
    home: Scaffold(
      // 顶部操作栏
      appBar: AppBar(
        title: Text('标题'),
        backgroundColor: Colors.pink,
      ),
      // 配出正文主题部分
      body: Main(),
    ),
  ));
}

class Main extends StatelessWidget {
  Main({Key? key}) : super(key: key);

  Map data = {
    "createTime": "2024-08-15 21:49:48",
    "orderState": 2,
    "image":
        "https://yanxuan-item.nosdn.127.net/a09de222ed32efa8ffe359b1d5780574.jpg",
    "name": "茶水分离杯耐热隔热玻璃杯",
    "totalNum": 2,
    "curPrice": 119.5,
    "totalMoney": 119.5,
    "attrsText": "规格:白色240ml"
  };

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.all(5),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.end,
        children: [
          // 1. 顶部创建时间 和 待发货
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Text(data['createTime']),
              Text('待发货',  style: TextStyle(color: Colors.amber, fontWeight: FontWeight.bold),),
            ],
          ),
          // 2.  图片+商品接受
          Row(
            children: [
              Image.network(data['image'], width: 100),
              Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Row(
                    children: [
                      Text(data['name']),
                      Text( 'x' + data['totalNum'].toString()),
                    ],
                  ),
                  Text(data['attrsText']),  
                  Text('¥' +  data['curPrice'].toString()),
                ],
              )
            ],
          ),
          Text('合计: 300'),
          Container(
            child: Text('再次购买'),
            decoration: BoxDecoration(border: Border.all(width: 2)),
          )
          
         
        ],
      ),
      
    );
  }
}
